﻿using UnityEngine;
using UnityEditor;

[CreateAssetMenu(menuName = "Rendering/Custom Deferred Shading Settings")]
public class DeferredShadingSettings : ScriptableObject {
	[SerializeField]
	Shader shader = default;
	[System.NonSerialized]
	Material material;

	[SerializeField]
	public bool useDeferredShading = false;
	[SerializeField]
	public bool displayGBuffer = false;

	public Material Material {
		get {
			if (material == null && shader != null) {
				material = new Material(shader);
				material.hideFlags = HideFlags.HideAndDontSave;
			}
			return material;
		}
	}
}